package com.sigetdriver.entities;

import java.io.Serializable;

import com.dsbmobile.dsbframework.controller.persistence.Entity;
import com.dsbmobile.dsbframework.controller.persistence.TableHelper;
import com.sigetdriver.persistence.DatabaseConstants;
import com.sigetdriver.persistence.SigetDriverEntityFactory;

public class NotificacionesBean extends Entity implements Serializable {
	
	private static final long serialVersionUID = 1L;

	private String message;
	private String created_at;

	
	// COLUMNA 1
	public final static String CREATED_AT_COLUMN_NAME = "created_at";
	public final static String CREATED_AT_COLUMN_TYPE = TableHelper.VARCHAR_DATATYPE_NAME + "(30)";
	public final static int CREATED_AT_COLUMN_ORDER = 1;
	// COLUMNA 2
	public final static String MESSAGE_COLUMN_NAME = "message";
	public final static String MESSAGE_COLUMN_TYPE = TableHelper.VARCHAR_DATATYPE_NAME + "(350)";
	public final static int MESSAGE_COLUMN_ORDER = 2;
	
	
	
	/**
	 * @param message
	 * @param created_at
	 */
	public NotificacionesBean(String message, String created_at) {
		super();
		this.message = message;
		this.created_at = created_at;
	}

	public NotificacionesBean() {
	
	}


	/**
	 * @return the message
	 */
	public String getMessage() {
		return message;
	}
	/**
	 * @param message the message to set
	 */
	public void setMessage(String message) {
		this.message = message;
	}
	/**
	 * @return the created_at
	 */
	public String getCreated_at() {
		return created_at;
	
	}
	/**
	 * @param created_at the created_at to set
	 */
	public void setCreated_at(String created_at) {
		this.created_at = created_at;
	}


	

	public static final TableHelper tableHelper = new TableHelper(
			DatabaseConstants.NOTIFICATIONS_TABLE_NAME, new SigetDriverEntityFactory())
			.addColumn(CREATED_AT_COLUMN_NAME, CREATED_AT_COLUMN_TYPE, CREATED_AT_COLUMN_ORDER)
			.addColumn(MESSAGE_COLUMN_NAME, MESSAGE_COLUMN_TYPE, MESSAGE_COLUMN_ORDER)
			;
	
	
	@Override
	public Object getColumnValue(int column) {
		
		switch (column) {
		case CREATED_AT_COLUMN_ORDER:
			return created_at;
		case MESSAGE_COLUMN_ORDER:
			return message;		
		}
		return null;
	}
	
	
	@Override
	public void setColumnValue(int column, Object object) {
		
		switch (column) {
		case CREATED_AT_COLUMN_ORDER:
			created_at = (String) object;
			break;
		case MESSAGE_COLUMN_ORDER:
			message = (String) object;
			break;	
		}
	}
	
	
}
